package com.hxkcloud.patient.request;

import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;

import com.google.gson.Gson;
import com.hxkcloud.patient.beans.AddDrugBean;
import com.hxkcloud.patient.beans.AddressesBean;
import com.hxkcloud.patient.beans.ArticleBeanKind;
import com.hxkcloud.patient.beans.ArticleWholeBean;
import com.hxkcloud.patient.beans.AssessFeedbackBean;
import com.hxkcloud.patient.beans.AssessRecordWholeBean;
import com.hxkcloud.patient.beans.AssessScoreWholeBean;
import com.hxkcloud.patient.beans.BannerWholeBean;
import com.hxkcloud.patient.beans.BasicInfoTimeWholeBean;
import com.hxkcloud.patient.beans.BasicinfosWholeBean;
import com.hxkcloud.patient.beans.BetterPlanEditBean;
import com.hxkcloud.patient.beans.BetterPlanEditDetailBean;
import com.hxkcloud.patient.beans.BetterPlanWholeBean;
import com.hxkcloud.patient.beans.BindingUsersBean;
import com.hxkcloud.patient.beans.CardiographReport;
import com.hxkcloud.patient.beans.CheckNewMsgWholeBean;
import com.hxkcloud.patient.beans.CodeImageBean;
import com.hxkcloud.patient.beans.CommentResultBean;
import com.hxkcloud.patient.beans.ConsultMsgShowBean;
import com.hxkcloud.patient.beans.ConsulteBeanList;
import com.hxkcloud.patient.beans.DepartmentIndexInfo;
import com.hxkcloud.patient.beans.DepartmentOrderWholeBean;
import com.hxkcloud.patient.beans.DepartmentWholeBean;
import com.hxkcloud.patient.beans.DisabilityListBean;
import com.hxkcloud.patient.beans.DischargeWholeBean;
import com.hxkcloud.patient.beans.DiseaseWholeBean;
import com.hxkcloud.patient.beans.DoOrderEditResultBean;
import com.hxkcloud.patient.beans.DoctorAssessWholeBean;
import com.hxkcloud.patient.beans.DoctorGroupWholeBean;
import com.hxkcloud.patient.beans.DoctorPatientResultBean;
import com.hxkcloud.patient.beans.DoctorPriceListBean;
import com.hxkcloud.patient.beans.DolistBean;
import com.hxkcloud.patient.beans.DolistEditFuncBean;
import com.hxkcloud.patient.beans.DolistWholeBean;
import com.hxkcloud.patient.beans.DpatientInfoWholeBean;
import com.hxkcloud.patient.beans.DrugsList;
import com.hxkcloud.patient.beans.FileUploadWholeBean;
import com.hxkcloud.patient.beans.FilterListBean;
import com.hxkcloud.patient.beans.FilterPatientBean;
import com.hxkcloud.patient.beans.HospitalStatusWholeBean;
import com.hxkcloud.patient.beans.InspectionReportWholeBean;
import com.hxkcloud.patient.beans.LastReportMonthBean;
import com.hxkcloud.patient.beans.LineListBean;
import com.hxkcloud.patient.beans.LoginInfo;
import com.hxkcloud.patient.beans.MonitorBean;
import com.hxkcloud.patient.beans.MonitorInputEditBean;
import com.hxkcloud.patient.beans.MonitorInputValueBean;
import com.hxkcloud.patient.beans.MonitorKindWholeBean;
import com.hxkcloud.patient.beans.MyChartListBean;
import com.hxkcloud.patient.beans.MyCollectionListBean;
import com.hxkcloud.patient.beans.MyFollowListBean;
import com.hxkcloud.patient.beans.MyReportListBean;
import com.hxkcloud.patient.beans.MyReportValueBean;
import com.hxkcloud.patient.beans.NurseMonitorWholeBean;
import com.hxkcloud.patient.beans.NurseWholeBean;
import com.hxkcloud.patient.beans.OrderListBean;
import com.hxkcloud.patient.beans.PatientAssessWholeBean;
import com.hxkcloud.patient.beans.PatientCaseNumberBean;
import com.hxkcloud.patient.beans.PatientEvalutionWholeBean;
import com.hxkcloud.patient.beans.PatientHistoryDateWholeBean;
import com.hxkcloud.patient.beans.PatientHistoryWholeBean;
import com.hxkcloud.patient.beans.PatientIdBean;
import com.hxkcloud.patient.beans.PatientInfoBean;
import com.hxkcloud.patient.beans.PatientRemindWholeBean;
import com.hxkcloud.patient.beans.PatientWholeBean;
import com.hxkcloud.patient.beans.PregnantInfo;
import com.hxkcloud.patient.beans.QuestionBean;
import com.hxkcloud.patient.beans.RegisterNurseInfo;
import com.hxkcloud.patient.beans.RegisterPatientInfo;
import com.hxkcloud.patient.beans.RemindDateListBean;
import com.hxkcloud.patient.beans.RemindTimeBean;
import com.hxkcloud.patient.beans.ScaleBean;
import com.hxkcloud.patient.beans.SearchRecordBeanList;
import com.hxkcloud.patient.beans.StopDrugsRecordWholeBean;
import com.hxkcloud.patient.beans.SystemMsgWholeBean;
import com.hxkcloud.patient.beans.TakeDrugsRecordWholeBean;
import com.hxkcloud.patient.beans.UchatListBean;
import com.hxkcloud.patient.beans.UpdateUserInfo;
import com.hxkcloud.patient.beans.UserInfoWholeBean;
import com.hxkcloud.patient.beans.UserManagerInfo;
import com.hxkcloud.patient.beans.UserMsgBean;
import com.hxkcloud.patient.beans.VerCodeInfo;
import com.hxkcloud.patient.beans.VersionBean;
import com.hxkcloud.patient.beans.VersionInfo;
import com.hxkcloud.patient.beans.WeiXinPayBean;
import com.hxkcloud.patient.beans.resultbeans.ArticleKindWholeBean;
import com.hxkcloud.patient.beans.resultbeans.BaseResultBean;
import com.hxkcloud.patient.beans.resultbeans.ObjectResultBean;
import com.hxkcloud.patient.interfaces.IResponseNewMsgInfoListener;
import com.hxkcloud.patient.utils.ImageVideoUtils;
import com.hxkcloud.patient.utils.WebUtils;
import com.zhy.http.okhttp.OkHttpUtils;
import com.zhy.http.okhttp.builder.PostFormBuilder;
import com.zhy.http.okhttp.callback.StringCallback;

import java.io.File;
import java.util.LinkedHashMap;
import java.util.List;

import okhttp3.Call;

/**
 * Description: 网络接口请求统一处理
 */
public class YiJiaHuNetWorkUtils extends BaseParams {

    private static final String SUCCESS = "0";// 成功
    private static final String FAILURE = "1";// 失败























    /**
     * 创建message
     */
    public static Message createMsg(int what, Object obj) {
        Message msg = new Message();
        msg.what = what;
        if (obj != null) {
            msg.obj = obj;
        }
        return msg;
    }

    /**
     * =========================================================================================================================================
     * 具体的网络操�?
     */












    /**
     * 获取心电图列表
     *
     * @param mHandler
     */

    public static void takePost(String patientID, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientID", patientID);
            OkHttpUtils.post().url(UrlAddress.TAKE_POST_URL)
                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            System.out.println("response====" + e.getMessage());
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_REPORTLIST_FAILURE);

                        }

                        @Override
                        public void onResponse(String response) {

                            System.out.println("response==takeReportList==" + response);

                            if (!TextUtils.isEmpty(response)) {

                                LinkedHashMap<String, String>
                                        hashMap = new LinkedHashMap<String, String>();
                                ObjectResultBean< LinkedHashMap<String,String>> result = GsonUtils.json2Object(response,  (Class<LinkedHashMap<String, String>>)hashMap.getClass());
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_REPORTLIST_SUCCESS, result));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_REPORTLIST_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_REPORTLIST_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_REPORTLIST_FAILURE);
                            }

                        }
                    }

            );
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }








    /**
     * 心电图医生诊断提交接口
     *
     * @param mHandler
     */

    public static void addCardiographDiagnose(String paitentID,String diagnose,String doctorID,String reportID, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientID", paitentID);
            postParameter.put("reportID", reportID);
            postParameter.put("diagnose", diagnose);
            postParameter.put("doctorID", doctorID);

            OkHttpUtils.post().url(UrlAddress.ADD_CARD_DIAGNOSE_URL)
                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            System.out.println("response====" + e.getMessage());
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response==addCardiographDiagnose==" + response);

                        }
                    }

            );
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }







    /**
     * 上传心电图接口
     *
     * @param mHandler
     */

    public static void uploadReport(String deviseID,String createTime,String xml,String image,String patientID,String departmentId, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("deviseID", deviseID);
            postParameter.put("createTime", createTime);
            postParameter.put("xml", xml);
            postParameter.put("image", image);
            postParameter.put("patientID", patientID);
            postParameter.put("departmentID", departmentId);

            OkHttpUtils.post().url(UrlAddress.UPLOAD_REPORT_URL)
                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            System.out.println("response====" + e.getMessage());
                        }
                        @Override
                        public void onResponse(String response) {
                            System.out.println("response==uploadReport==" + response);
                            if (!TextUtils.isEmpty(response)) {
                                ObjectResultBean<CardiographReport> result = GsonUtils.json2Object(response, CardiographReport.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE__HDCUPLOAD_SUCCESS, result.getData()));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE__HDCUPLOAD_SUCCESS, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE__HDCUPLOAD_SUCCESS);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE__HDCUPLOAD_SUCCESS);
                            }
                        }
                    }

            );
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }





    /**
     * 获取出院小结
     */
    public static void getDischargeSummary( int pageIndex, int pageSize, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("pageIndex", pageIndex);
            postParameter.put("pageSize", pageSize);
            OkHttpUtils.post().url(UrlAddress.GET_DISCHARGE_SUMMARY_URL)
                    .addParams("Data", new Gson().toJson(postParameter)).build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.GET_DISCHARGE_SUMMARY_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            //System.out.println("response==getNurseList==" + response);
                            Log.e("出院小结", response);
                            if (!TextUtils.isEmpty(response)) {
                                ObjectResultBean<DischargeWholeBean> result = GsonUtils.json2Object(response, DischargeWholeBean.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.GET_DISCHARGE_SUMMARY_SUCCESS, result.getData()));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.GET_DISCHARGE_SUMMARY_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.GET_DISCHARGE_SUMMARY_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.GET_DISCHARGE_SUMMARY_FAILURE);
                            }
                        }
                    });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }


    /**
     * 获取验证码register
     *
     * @param mHandler
     */
    public static void getCode(String tel, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("tel", tel);

            OkHttpUtils.post().url(UrlAddress.GETCODE_URl)
                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETCODE_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response====" + response);
                            if (!TextUtils.isEmpty(response)) {

                                ObjectResultBean<VerCodeInfo> result = GsonUtils.json2Object(response, VerCodeInfo.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETCODE_SUCCESS, result));

                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETCODE_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETCODE_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETCODE_FAILURE);
                            }
                        }
                    }
            );
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 注册验证码校�?
     *
     * @param mHandler
     */
    public static void getCheckCode(String tel, String code, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("tel", tel);
            postParameter.put("code", code);

            OkHttpUtils.post().url(UrlAddress.CHECKCODE_URL)
                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CHECKCODE_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response====" + response);
                            if (!TextUtils.isEmpty(response)) {
                                ObjectResultBean<VerCodeInfo> result = GsonUtils.json2Object(response, VerCodeInfo.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS + "")) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_CHECKCODE_SUCCESS, result));

                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_CHECKCODE_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CHECKCODE_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CHECKCODE_FAILURE);
                            }
                        }
                    }
            );
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 患者注�?
     *
     * @param mHandler
     */
    public static void registerPatient(String tel, String paswords, String name, String age, String sex, String height, String weight, String address, String areaId, String caseNumber, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(false);
            postParameter.put("tel", tel);
            postParameter.put("paswords", paswords);
            postParameter.put("name", name);
            postParameter.put("age", age);
            postParameter.put("sex", sex);
            postParameter.put("height", height);
            postParameter.put("weight", weight);
            postParameter.put("address", address);
            postParameter.put("addressId", areaId);
            postParameter.put("caseNumber", caseNumber);

            System.out.println("===" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.REGISTPATIENT_URL)

                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_REGISTERPATIENT_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response==registerPatient==" + response);
                            if (!TextUtils.isEmpty(response)) {

                                ObjectResultBean<RegisterPatientInfo> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), RegisterPatientInfo.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS + "")) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_REGISTERPATIENT_SUCCESS, result));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_REGISTERPATIENT_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_REGISTERPATIENT_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_REGISTERPATIENT_FAILURE);
                            }
                        }
                    }

            );
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }


    /**
     * 护士注册
     *
     * @param mHandler
     */

    public static void registerNurse(String tel, String paswords, String name, String title, String department, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(false);
            postParameter.put("tel", tel);
            postParameter.put("paswords", paswords);
            postParameter.put("name", name);
            postParameter.put("title", title);
            postParameter.put("department", department);

            OkHttpUtils.post().url(UrlAddress.REGISTNURSE_URL)
                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_REGISTERNURSE_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response====" + response);
                            if (!TextUtils.isEmpty(response)) {

                                ObjectResultBean<RegisterNurseInfo> result = GsonUtils.json2Object(response, RegisterNurseInfo.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS + "")) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_REGISTERNURSE_SUCCESS, result));

                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_REGISTERNURSE_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_REGISTERNURSE_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_REGISTERNURSE_FAILURE);
                            }
                        }
                    }

            );
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 登录
     *
     * @param mHandler
     */

    public static void submitLogin(String phoneNumber, String password, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("tel", phoneNumber);
            postParameter.put("password", password);

            OkHttpUtils.post().url(UrlAddress.LOGIN_URL)
                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            System.out.println("response====" + e.getMessage());
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_SUBMITLOGIN_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response==submitLogin==" + response);
                            if (!TextUtils.isEmpty(response)) {
                                ObjectResultBean<LoginInfo> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), LoginInfo.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS) && result.getData() != null && !TextUtils.isEmpty(result.getData().getUserId())) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_SUBMITLOGIN_SUCCESS, result));

                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_SUBMITLOGIN_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_SUBMITLOGIN_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_SUBMITLOGIN_FAILURE);
                            }
                        }
                    }

            );
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 获取省市�?
     */
    public static void addressList(final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(false);
            OkHttpUtils.post().url(UrlAddress.ADDRESSLIST_URL).build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            System.out.println("addresslist====" + e.getMessage());
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETADDRESSLIST_FAIL);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response====addresslist");
                            if (!TextUtils.isEmpty(response)) {
                                ObjectResultBean<AddressesBean> result = GsonUtils.json2Object(response, AddressesBean.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETADDRESSLIST_SUCCESS, result.getData()));
                                    } else {
                                        handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETADDRESSLIST_FAIL, result.getMessage()));
                                    }
                                } else {
                                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETADDRESSLIST_FAIL);
                                }
                            } else {
                                handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETADDRESSLIST_FAIL);
                            }
                        }
                    }
            );
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 资讯/课堂文章类别列表
     */
    public static void articleKindList(final String departmentId, final String type, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("departmentId", departmentId);
            postParameter.put("type", type);
            OkHttpUtils.post().url(UrlAddress.ARTICLEKINDLIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_ARTICLEKINDLIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response===articleKindList=" + response+":"+departmentId);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<ArticleKindWholeBean> result = GsonUtils.json2Object(response, ArticleKindWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                if (type.equals("0")) {
                                    mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_ARTICLEKINDLIST_SUCCESS0, result.getData().getList()));
                                } else {
                                    mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_ARTICLEKINDLIST_SUCCESS1, result.getData().getList()));
                                }
                            } else {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_ARTICLEKINDLIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_ARTICLEKINDLIST_FAILURE);
                        }
                    } else {
                        mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_ARTICLEKINDLIST_FAILURE);
                    }
                }
            });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 资讯/课堂文章列表
     */
    public static void articleList(String departmentId, String keyword, String kind, String type, int pageIndex, int pageSize, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
//            {"departmentId":"1","type":"3","kind":"11","pageSize":"15","pageIndex":"1"}
            postParameter.put("departmentId", departmentId);
            if (!"".equals(keyword)) {
                postParameter.put("keyword", keyword);
            }
            if (!"".equals(kind)) {
                postParameter.put("kind", kind);
            }
            postParameter.put("type", type);
            postParameter.put("pageIndex", pageIndex + "");
            postParameter.put("pageSize", pageSize + "");
            System.out.println(new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.ARTICLELIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    System.out.println("response====" + e.getMessage());
                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_ARTICLELIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<ArticleWholeBean> result = GsonUtils.json2Object(response, ArticleWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_ARTICLELIST_SUCCESS, result.getData()));
                            } else {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_ARTICLELIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_ARTICLELIST_FAILURE);
                        }
                    } else {
                        mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_ARTICLELIST_FAILURE);
                    }
                }
            });
        }
    }

    /**
     * 新的文章列表
     */
    public static void newarticleList(String departmentId, String keyword, String kind, String type, int pageIndex, int pageSize, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
//            {"departmentId":"1","type":"3","kind":"11","pageSize":"15","pageIndex":"1"}
            postParameter.put("departmentId", departmentId);
            if (!"".equals(keyword)) {
                postParameter.put("keyword", keyword);
            }
            if (!"".equals(kind)) {
                postParameter.put("kind", kind);
            }
            if (!"".equals(type)) {
                postParameter.put("category", type);
            }

            postParameter.put("pageIndex", pageIndex + "");
            postParameter.put("pageSize", pageSize + "");
            System.out.println(new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.ARTICLELIST_NEW_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    System.out.println("response====" + e.getMessage());
                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_ARTICLELIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<ArticleWholeBean> result = GsonUtils.json2Object(response, ArticleWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_ARTICLELIST_SUCCESS, result.getData()));
                            } else {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_ARTICLELIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_ARTICLELIST_FAILURE);
                        }
                    } else {
                        mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_ARTICLELIST_FAILURE);
                    }
                }
            });
        }
    }

    /**
     * 获取BANNER
     */
    public static void getBannerList(String departmentId, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
//            {"departmentId":"1","type":"3","kind":"11","pageSize":"15","pageIndex":"1"}
            postParameter.put("departmentId", departmentId);
         //   System.out.println(new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.BANNER_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    System.out.println("response====" + e.getMessage());
                    mHandler.sendEmptyMessage(MessageCode.BANNER_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    Log.e("测试-->",response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<BannerWholeBean> result = GsonUtils.json2Object(response, BannerWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                mHandler.sendMessage(createMsg(MessageCode.BANNER_SUCCESS, result.getData()));
                            } else {
                                mHandler.sendMessage(createMsg(MessageCode.BANNER_FAILURE, result.getMessage()));
                            }
                        } else {
                            mHandler.sendEmptyMessage(MessageCode.BANNER_FAILURE);
                        }
                    } else {
                        mHandler.sendEmptyMessage(MessageCode.BANNER_FAILURE);
                    }
                }
            });
        }
    }


    /**
     * 资讯/课堂文章收藏
     */
    public static void collectArtical(String newsId, String collect, String type, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);

            postParameter.put("newsId", newsId);
            postParameter.put("collect", collect);
            postParameter.put("type", type);

            System.out.println(new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.ARTICLELCOLLECT_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    System.out.println("response====" + e.getMessage());
                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_COLLECTARTICALINFO_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2Result(response, BaseResultBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_COLLECTARTICALINFO_SUCCESS, result.getMessage()));
                            } else {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_COLLECTARTICALINFO_FAILURE, result.getMessage()));
                            }
                        } else {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_COLLECTARTICALINFO_FAILURE);
                        }
                    } else {
                        mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_COLLECTARTICALINFO_FAILURE);
                    }
                }
            });
        }
    }

    /**
     * 资讯/课堂文章是否收藏
     */
    public static void ArticalIsCollect(String newsId,String type, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("newsId", newsId);
//            postParameter.put("collect", collect);
            postParameter.put("type", type);

            System.out.println(new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.ARTICLELISCOLLECT_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    System.out.println("ArticalIsCollect====" + e.getMessage());
                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_ARTICALISCOLLECT_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("ArticalIsCollect====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2Result(response, BaseResultBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_ARTICALISCOLLECT_SUCCESS, result.getMessage()));
                            } else {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_ARTICALISCOLLECT_FAILURE, result.getMessage()));
                            }
                        } else {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_ARTICALISCOLLECT_FAILURE);
                        }
                    } else {
                        mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_ARTICALISCOLLECT_FAILURE);
                    }
                }
            });
        }
    }
    /**
     * 资讯/课堂文章评论
     */
    public static void commentArtical(String newsId, String comment, String acctType, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);

            postParameter.put("newsId", newsId);
            postParameter.put("comment", comment);
            postParameter.put("type", acctType);

            System.out.println(new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.ARTICLELCOMMENT_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    System.out.println("response====" + e.getMessage());
                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_COMMENTARTICALINFO_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<CommentResultBean> result = GsonUtils.json2Object(response, CommentResultBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_COMMENTARTICALINFO_SUCCESS, result));
                            } else {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_COMMENTARTICALINFO_FAILURE, result.getMessage()));
                            }
                        } else {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_COMMENTARTICALINFO_FAILURE);
                        }
                    } else {
                        mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_COMMENTARTICALINFO_FAILURE);
                    }
                }
            });
        }
    }


    /**
     * 我的收藏
     */
    public static void myCollection(final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);

            System.out.println(new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.MYCOLLECTIONINFO_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    System.out.println("response====" + e.getMessage());
                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_MYCOLLECTIONLISTINFO_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<MyCollectionListBean> result = GsonUtils.json2Object(response, MyCollectionListBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_MYCOLLECTIONLISTINFO_SUCCESS, result));
                            } else {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_MYCOLLECTIONLISTINFO_FAILURE, result.getMessage()));
                            }
                        } else {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_MYCOLLECTIONLISTINFO_FAILURE);
                        }
                    } else {
                        mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_MYCOLLECTIONLISTINFO_FAILURE);
                    }
                }
            });
        }
    }

    /**
     * 我的随访
     */
    public static void myFollowUp(final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);

            System.out.println(new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.MYFOLLOWUPINFO_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    System.out.println("response====" + e.getMessage());
                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_MYFOLLOWUPLISTINFO_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====myFollowUp" + response);
                    Log.i("response====myFollowUp","response:"+response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<MyFollowListBean> result = GsonUtils.json2Object(response, MyFollowListBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_MYFOLLOWUPLISTINFO_SUCCESS, result));
                            } else {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_MYFOLLOWUPLISTINFO_FAILURE, result.getMessage()));
                            }
                        } else {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_MYFOLLOWUPLISTINFO_FAILURE);
                        }
                    } else {
                        mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_MYFOLLOWUPLISTINFO_FAILURE);
                    }
                }
            });
        }
    }

    /**
     * 我的二维码图�?
     */
    public static void myQrcodeImage(final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);

            System.out.println(new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.MYQRCODEIMAGE_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    System.out.println("response====" + e.getMessage());
                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_MYQRCODEIMAGE_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<CodeImageBean> result = GsonUtils.json2Object(response, CodeImageBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_MYQRCODEIMAGE_SUCCESS, result));
                            } else {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_MYQRCODEIMAGE_FAILURE, result.getMessage()));
                            }
                        } else {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_MYQRCODEIMAGE_FAILURE);
                        }
                    } else {
                        mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_MYQRCODEIMAGE_FAILURE);
                    }
                }
            });
        }
    }

    /**
     * 退出登�?
     *
     * @param mHandler
     */
    public static void logout(final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);

            OkHttpUtils.post().url(UrlAddress.LOGOUT_URL)
                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_LOGOUT_FAILURE);
                            System.out.println("response====" + e.getMessage());
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response====" + response);
                            if (!TextUtils.isEmpty(response)) {
                                BaseResultBean result = GsonUtils.json2BaseBean(response);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_LOGOUT_SUCCESS, result.getMessage()));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_LOGOUT_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_LOGOUT_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_LOGOUT_FAILURE);
                            }
                        }
                    }
            );
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 修改密码
     *
     * @param mHandler
     */
    public static void updatePassword(String oldPassword, String NewPassword, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);

            postParameter.put("oldPassword", oldPassword);
            postParameter.put("NewPassword", NewPassword);
            System.out.println("===" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.UPDATEPW_URL)
                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_UPDATEPW_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response====" + response);
                            if (!TextUtils.isEmpty(response)) {
                                ObjectResultBean<String> result = GsonUtils.json2Object(response, String.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_UPDATEPW_SUCCESS, result));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_UPDATEPW_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_UPDATEPW_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_UPDATEPW_FAILURE);
                            }
                        }
                    }
            );
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 找回密码
     *
     * @param mHandler
     */
    public static void retrievePassword(String tel, String code, String password, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);

            postParameter.put("tel", tel);
            postParameter.put("code", code);
            postParameter.put("password", password);

            OkHttpUtils.post().url(UrlAddress.RETRIEVEPW_URL)
                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_RETRIEVEPW_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response====" + response);
                            if (!TextUtils.isEmpty(response)) {
                                BaseResultBean result = GsonUtils.json2Result(response, BaseResultBean.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_RETRIEVEPW_SUCCESS, result));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_RETRIEVEPW_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_RETRIEVEPW_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_RETRIEVEPW_FAILURE);
                            }
                        }
                    }
            );
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }


    /**
     * 科室首页信息
     *
     * @param mHandler
     */
    public static void getDepartmentIndexInfo(String departmentId, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("departmentId", departmentId);

            OkHttpUtils.post().url(UrlAddress.DEPARTMENTINDEX_URL)
                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETDEPARTMENTINDEXINFO_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            //Log.e("首页", response);
                            if (!TextUtils.isEmpty(response)) {
                                ObjectResultBean<DepartmentIndexInfo> result = GsonUtils.json2Object(response, DepartmentIndexInfo.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETDEPARTMENTINDEXINFO_SUCCESS, result.getData()));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETDEPARTMENTINDEXINFO_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETDEPARTMENTINDEXINFO_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETDEPARTMENTINDEXINFO_FAILURE);
                            }
                        }
                    }
            );
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 科室患者列�?
     */
    public static void getPatientList(String departmentId, int isBinding, int pageIndex, int pageSize, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("departmentId", departmentId);
            postParameter.put("isBinding", isBinding);
            postParameter.put("pageIndex", pageIndex);
            postParameter.put("pageSize", pageSize);
            OkHttpUtils.post().url(UrlAddress.PATIENTLIST_URL)
                    .addParams("Data", new Gson().toJson(postParameter)).build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETDEPARTMENTPATIENTLIST_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response===getPatientList===" + response);
                            if (!TextUtils.isEmpty(response)) {
                                ObjectResultBean<PatientWholeBean> result = GsonUtils.json2Object(response, PatientWholeBean.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETDEPARTMENTPATIENTLIST_SUCCESS, result.getData()));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETDEPARTMENTPATIENTLIST_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETDEPARTMENTPATIENTLIST_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETDEPARTMENTPATIENTLIST_FAILURE);
                            }
                        }
                    });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 科室护士列表
     */
    public static void getNurseList(String departmentId, int pageIndex, int pageSize, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("departmentID", departmentId);
            postParameter.put("pageIndex", pageIndex);
            postParameter.put("pageSize", pageSize);
            OkHttpUtils.post().url(UrlAddress.NURSELIST_URL)
                    .addParams("Data", new Gson().toJson(postParameter)).build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETDEPARTMENTNURSELIST_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response==getNurseList==" + response);
                            if (!TextUtils.isEmpty(response)) {
                                ObjectResultBean<NurseWholeBean> result = GsonUtils.json2Object(response, NurseWholeBean.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETDEPARTMENTNURSELIST_SUCCESS, result.getData()));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETDEPARTMENTNURSELIST_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETDEPARTMENTNURSELIST_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETDEPARTMENTNURSELIST_FAILURE);
                            }
                        }
                    });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 科室护士all列表
     */
    public static void getNurseListWhole(String departmentId, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("departmentID", departmentId);
            OkHttpUtils.post().url(UrlAddress.NURSELISTWHOLE_URL)
                    .addParams("Data", new Gson().toJson(postParameter)).build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETDEPARTMENTNURSELIST_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response==getNurseListWhole==" + response);
                            if (!TextUtils.isEmpty(response)) {
                                ObjectResultBean<NurseWholeBean> result = GsonUtils.json2Object(response, NurseWholeBean.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETDEPARTMENTNURSELIST_SUCCESS, result.getData()));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETDEPARTMENTNURSELIST_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETDEPARTMENTNURSELIST_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETDEPARTMENTNURSELIST_FAILURE);
                            }
                        }
                    });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 意见反馈
     *
     * @param content
     * @param mHandler
     */
    public static void submitFeedbackInfo(String content, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("content", content);
            System.out.println("===" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.FEEDBACKINFO_URL)
                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_SUBMITFEEDBACKINFO_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response====" + response);
                            if (!TextUtils.isEmpty(response)) {
                                BaseResultBean result = GsonUtils.json2Result(response, BaseResultBean.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_SUBMITFEEDBACKINFO_SUCCESS, result));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_SUBMITFEEDBACKINFO_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_SUBMITFEEDBACKINFO_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_SUBMITFEEDBACKINFO_FAILURE);
                            }
                        }
                    }
            );
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }


    /**
     * 护士绑定患�?
     */
    public static void patientBinding(String patientId, String groupId, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            postParameter.put("groupId", groupId);
            OkHttpUtils.post().url(UrlAddress.PATIENTBINDING_URL).addParams("Data", new Gson().toJson(postParameter)).build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTBINDING_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            if (!TextUtils.isEmpty(response)) {
                                BaseResultBean result = GsonUtils.json2BaseBean(response);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTBINDING_SUCCESS, result.getMessage()));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTBINDING_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTBINDING_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTBINDING_FAILURE);
                            }
                        }
                    });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }


    /**
     * 版本更新
     *
     * @param currentVersion
     * @param mHandler
     */
    public static void checkVersionInfo(String currentVersion, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("currentVersion", currentVersion);
            System.out.println("===" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.CHECKVERSION_URL)
                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_UPDATEVERSIONINFO_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response====" + response);
                            if (!TextUtils.isEmpty(response)) {
                                ObjectResultBean<VersionInfo> result = GsonUtils.json2Object(response, VersionInfo.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_UPDATEVERSIONINFO_SUCCESS, result));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_UPDATEVERSIONINFO_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_UPDATEVERSIONINFO_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_UPDATEVERSIONINFO_FAILURE);
                            }
                        }
                    }
            );
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }
    /**
     * 系统消息获取标题
     *
     * */
    public static void getSystemMsgKind(String articleId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("articleId", articleId);
            OkHttpUtils.post().url(UrlAddress.GETSYSTEMMSGKIND_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETSYSTEMMSGKIND_FAILURE);
                }
                @Override
                public void onResponse(String response) {
                    System.out.println("responses====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<ArticleBeanKind> result = GsonUtils.json2Object(response, ArticleBeanKind.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETSYSTEMMSGKIND_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETSYSTEMMSGKIND_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETSYSTEMMSGKIND_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETSYSTEMMSGKIND_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 修改个人信息
     *
     * @param mHandler
     */
    public static void updateUserInfo(LoginInfo userInfo, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("userId", userInfo.getUserId());
            postParameter.put("style", userInfo.getUserStyle());
            postParameter.put("name", userInfo.getName());
            postParameter.put("sex", userInfo.getSex());
            postParameter.put("birthday", userInfo.getAge());
            postParameter.put("height", userInfo.getHeight());
            postParameter.put("weight", userInfo.getWeight());
            postParameter.put("address", userInfo.getAddressId());
            postParameter.put("headImg", userInfo.getHeadImg());
            postParameter.put("Specialty", userInfo.getSpecialty());
            postParameter.put("caseNumber", userInfo.getCaseNumber());

            System.out.println(new Gson().toJson(postParameter));

            OkHttpUtils.post().url(UrlAddress.UPDATEUSERINFO_URL)
                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_UPDATEUSERINFO_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response====" + response);
                            if (!TextUtils.isEmpty(response)) {
                                ObjectResultBean<UpdateUserInfo> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), UpdateUserInfo.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_UPDATEUSERINFO_SUCCESS, result));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_UPDATEUSERINFO_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_UPDATEUSERINFO_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_UPDATEUSERINFO_FAILURE);
                            }
                        }
                    }
            );
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }


    /**
     * @param mHandler
     */
    public static void getDeliveryCycleInfo(final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);

            System.out.println(new Gson().toJson(postParameter));

            OkHttpUtils.post().url(UrlAddress.DELIVERYCYCLEINFO_URL)
                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_MYDELIVERYINFO_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response====" + response);
                            if (!TextUtils.isEmpty(response)) {
                                ObjectResultBean<PregnantInfo> result = GsonUtils.json2Object(response, PregnantInfo.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_MYDELIVERYINFO_SUCCESS, result));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_MYDELIVERYINFO_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_MYDELIVERYINFO_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_MYDELIVERYINFO_FAILURE);
                            }
                        }
                    }
            );
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }


    /**
     * 提交修改孕产信息
     *
     * @param mHandler
     */
    public static void submitDeliveryCycleInfo(String userId, String departmentId, String menstrualCycle, String menstrualStartDate, String DeliveryTime, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);

            postParameter.put("userId", userId);
            postParameter.put("menstrualCycle", menstrualCycle);
            postParameter.put("menstrualStartDate", menstrualStartDate);
            postParameter.put("DeliveryTime", DeliveryTime);
            postParameter.put("departmentId", departmentId);

            System.out.println(new Gson().toJson(postParameter));

            OkHttpUtils.post().url(UrlAddress.SUBMITDELIVERYCYCLEINFO_URL)
                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            System.out.println("response====" + e.getMessage());
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_SUBMITMYDELIVERYINFO_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response====" + response);
                            if (!TextUtils.isEmpty(response)) {
                                ObjectResultBean<String> result = GsonUtils.json2Object(response, String.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_SUBMITMYDELIVERYINFO_SUCCESS, result));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_SUBMITMYDELIVERYINFO_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_SUBMITMYDELIVERYINFO_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_SUBMITMYDELIVERYINFO_FAILURE);
                            }
                        }
                    }
            );
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 我的检查报告列�?
     */
    public static void MyInspectionReport(String userId, String date, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("userId", userId);
            postParameter.put("date", date);

            OkHttpUtils.post().url(UrlAddress.MYINSPECTIONREPORT_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_MYINSPECTIONREPORT_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<InspectionReportWholeBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), InspectionReportWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_MYINSPECTIONREPORT_SUCCESS, result.getData()));
                            } else {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_MYINSPECTIONREPORT_FAILURE, result.getMessage()));
                            }
                        } else {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_MYINSPECTIONREPORT_FAILURE);
                        }
                    } else {
                        mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_MYINSPECTIONREPORT_FAILURE);
                    }
                }
            });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 增加我的检查报�?
     */
    public static void addMyInspectionReport(String userId, String date, String title, String words, String voice, List<String> image, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("userId", userId);
            postParameter.put("date", date);
            postParameter.put("title", title);
            postParameter.put("words", words);
            postParameter.put("voice", voice);
            postParameter.put("image", image);
            OkHttpUtils.post().url(UrlAddress.ADDMYINSPECTIONREPORT_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDMYINSPECTIONREPORT_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_ADDMYINSPECTIONREPORT_SUCCESS, result.getMessage()));
                            } else {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_ADDMYINSPECTIONREPORT_FAILURE, result.getMessage()));
                            }
                        } else {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDMYINSPECTIONREPORT_FAILURE);
                        }
                    } else {
                        mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDMYINSPECTIONREPORT_FAILURE);
                    }
                }
            });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 编辑我的检查报�?
     */
    public static void editMyInspectionReport(String InspectionReportId, String patientId, String date, String title, String words, String voice, List<String> image, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("InspectionReportId", InspectionReportId);
            postParameter.put("patientId", patientId);
            postParameter.put("date", date);
            postParameter.put("title", title);
            postParameter.put("words", words);
            postParameter.put("voice", voice);
            postParameter.put("image", image);
            OkHttpUtils.post().url(UrlAddress.EDITMYINSPECTIONREPORT_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDMYINSPECTIONREPORT_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_ADDMYINSPECTIONREPORT_SUCCESS, result.getMessage()));
                            } else {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_ADDMYINSPECTIONREPORT_FAILURE, result.getMessage()));
                            }
                        } else {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDMYINSPECTIONREPORT_FAILURE);
                        }
                    } else {
                        mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDMYINSPECTIONREPORT_FAILURE);
                    }
                }
            });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 患者加入科�?
     */
    public static void departmentJoin(String departmentId, String user_id, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("departmentId", departmentId);
            postParameter.put("user_id", user_id);
            OkHttpUtils.post().url(UrlAddress.DEPARTMENTJOIN_URL).addParams("Data", new Gson().toJson(postParameter)).build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_DEPARTMENTJOIN_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response====" + response);
                            if (!TextUtils.isEmpty(response)) {
                                BaseResultBean result = GsonUtils.json2BaseBean(response);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_DEPARTMENTJOIN_SUCCESS, result.getMessage()));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_DEPARTMENTJOIN_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_DEPARTMENTJOIN_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_DEPARTMENTJOIN_FAILURE);
                            }
                        }
                    });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 患者退出科�?
     */
    public static void departmentLeft(String user_id, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("user_id", user_id);
            OkHttpUtils.post().url(UrlAddress.DEPARTMENTLEFT_URL).addParams("Data", new Gson().toJson(postParameter)).build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_DEPARTMENTLEFT_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response====" + response);
                            if (!TextUtils.isEmpty(response)) {
                                BaseResultBean result = GsonUtils.json2BaseBean(response);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_DEPARTMENTLEFT_SUCCESS, result.getMessage()));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_DEPARTMENTLEFT_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_DEPARTMENTLEFT_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_DEPARTMENTLEFT_FAILURE);
                            }
                        }
                    });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 统一文件上传接口
     */
    public static void FileUpload(List<File> files, String dir,
                                  final Handler mHandler) {
        System.out.println("fileuploadstart:" + files.size());
//        Map<String, File> fileMap = new HashMap<String, File>();
        if (files != null && files.size() > 0) {
//            for (File file : files) {
//                fileMap.put(file.getName(), file);
//            }
        } else {
            return;
        }

        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("dir", dir);
            PostFormBuilder builder = OkHttpUtils.post();
            for (File file : files) {
                builder.addFile(file.getName(), file.getName(), file);
            }
            builder
                    .url(UrlAddress.FILEUPLOAD_URL).addParams("Data", new Gson().toJson(postParameter)).build()
                    .execute(new FileCallBack() {

                        @SuppressWarnings("unused")
                        @Override
                        public void onResponse(String response) {
                            System.out.println("FileUpload==" + response);
//                            FileUploadResultBean result = GsonUtils
//                                    .json2Result(response,
//                                            FileUploadResultBean.class);
//                            if (result != null) {
//                                if (result.getCode().equals(SUCCESS)) {
//                                    mHandler.sendMessage(createMsg(
//                                            MessageCode.NETWORKCODE_FILEUPLOAD_SUCCESS,
//                                            result));
//                                } else {
//                                    mHandler.sendMessage(createMsg(
//                                            MessageCode.NETWORKCODE_FILEUPLOAD_FAILURE,
//                                            result.getMessage()));
//                                }
//                            } else {
//                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_FILEUPLOAD_FAILURE);
//                            }
                            ObjectResultBean<FileUploadWholeBean> result = GsonUtils.json2Object(response, FileUploadWholeBean.class);
                            if (result != null) {
                                if (result.getCode().equals(SUCCESS)) {
                                    System.out.println("fileuploadend:" + result.getData().getFileList().size());
                                    mHandler.sendMessage(createMsg(
                                            MessageCode.NETWORKCODE_FILEUPLOAD_SUCCESS,
                                            result.getData().getFileList()));
                                } else {
                                    mHandler.sendMessage(createMsg(
                                            MessageCode.NETWORKCODE_FILEUPLOAD_FAILURE,
                                            result.getMessage()));
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_FILEUPLOAD_FAILURE);
                            }
                        }

                        @Override
                        public String parseNetworkResponse(
                                okhttp3.Response response) throws Exception {
                            return super.parseNetworkResponse(response);
                        }

                        @Override
                        public void onError(Call arg0, Exception arg1) {
                            super.onError(arg0, arg1);
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_FILEUPLOAD_FAILURE);
                        }
                    });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 提交认证资料
     *
     * @param mHandler
     */
    public static void submitCertificationInfo(String userId, String name, String departmentName, String title, String workingYears, String school, String workUnit, List<String> images, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("userId", userId);
            postParameter.put("name", name);
            postParameter.put("departmentName", departmentName);
            postParameter.put("title", title);
            postParameter.put("workingYears", workingYears);
            postParameter.put("school", school);
            postParameter.put("workUnit", workUnit);
            postParameter.put("informationImage", images);


            System.out.println("response====renzheng==" + new Gson().toJson(postParameter));

            OkHttpUtils.post().url(UrlAddress.SUBMITCERTIFICATIONINFO_URL)
                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_SUBMITCERTIFICATIONINFO_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response====" + response);
                            if (!TextUtils.isEmpty(response)) {
                                ObjectResultBean<String> result = GsonUtils.json2Object(response, String.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_SUBMITCERTIFICATIONINFO_SUCCESS, result));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_SUBMITCERTIFICATIONINFO_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_SUBMITCERTIFICATIONINFO_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_SUBMITCERTIFICATIONINFO_FAILURE);
                            }
                        }
                    }
            );
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 基本数据更新时间
     */
    public static void getBasicInfoTimeList(final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            OkHttpUtils.post().url(UrlAddress.BASICTIMELIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETBASICINFOTIMELIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<BasicInfoTimeWholeBean> result = GsonUtils.json2Object(response, BasicInfoTimeWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETBASICINFOTIMELIST_SUCCESS, result.getData().getList()));
                            } else {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETBASICINFOTIMELIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETBASICINFOTIMELIST_FAILURE);
                        }
                    } else {
                        mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETBASICINFOTIMELIST_FAILURE);
                    }
                }
            });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 住院状态列�?
     */
    public static void getHospitalStatusList(final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            System.out.println("response==住院状�?=" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.HOSPITALSTATUSLIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_HOSPITALSTATUSLIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response==住院状�?=" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<HospitalStatusWholeBean> result = GsonUtils.json2Object(response, HospitalStatusWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_HOSPITALSTATUSLIST_SUCCESS, result.getData().getList()));
                            } else {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_HOSPITALSTATUSLIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_HOSPITALSTATUSLIST_FAILURE);
                        }
                    } else {
                        mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_HOSPITALSTATUSLIST_FAILURE);
                    }
                }
            });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 病种列表
     */
    public static void getDiseaseList(final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            OkHttpUtils.post().url(UrlAddress.DISEASELIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_DISEASELIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<DiseaseWholeBean> result = GsonUtils.json2Object(response, DiseaseWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_DISEASELIST_SUCCESS, result.getData()));
                            } else {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_DISEASELIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_DISEASELIST_FAILURE);
                        }
                    } else {
                        mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_DISEASELIST_FAILURE);
                    }
                }
            });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 文件下载(voice)
     * http://blog.csdn.net/lmj623565791/article/details/49734867
     */
    public static void downloadFile(String url, Context mContext, final Handler handler) {
        if (WebUtils.isConnected()) {
            OkHttpUtils.get().url(url).build().execute(new com.zhy.http.okhttp.callback.FileCallBack(ImageVideoUtils.getDataCacheDir(mContext), "voice.amr") {
                @Override
                public void inProgress(float progress, long total) {

                }

                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOWNLOADVOICE_FAILURE);
                }

                @Override
                public void onResponse(File response) {
                    handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DOWNLOADVOICE_SUCCESS, response));
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 患者信�?
     */
    public static void getPatientInfo(String patientId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            OkHttpUtils.post().url(UrlAddress.PATIENTINFO_URL).addParams("Data", new Gson().toJson(postParameter)).build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTINFO_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response====" + response);
                            if (!TextUtils.isEmpty(response)) {
                                ObjectResultBean<PatientInfoBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}").replace("cyMap\":\"\"", "cyMap\":{}").replace("fzMap\":\"\"", "fzMap\":{}"), PatientInfoBean.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTINFO_SUCCESS, result.getData()));
                                    } else {
                                        handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTINFO_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTINFO_FAILURE);
                                }
                            } else {
                                handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTINFO_FAILURE);
                            }
                        }
                    });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 修改患者住院状�?
     */
    public static void modifyHospitalStatus(String patientId, String status, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            postParameter.put("status", status);
            OkHttpUtils.post().url(UrlAddress.MODIFYHOSPITALSTATUS_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_MODIFYHOSPITALSTATUS_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_MODIFYHOSPITALSTATUS_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_MODIFYHOSPITALSTATUS_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_MODIFYHOSPITALSTATUS_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_MODIFYHOSPITALSTATUS_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }

    }

    /**
     * 获取患者列表GETPATIENTLISTINFO_URL
     */

    public static void getPatientListInfo(String inHospital, String disease, String date, String dateKind, String keyword, int pageIndex, int pageSize, final Handler mHandler) {

        if (WebUtils.isConnected()) {
            instance(true);

            postParameter.put("inHospital", inHospital);
            postParameter.put("disease", disease);
            postParameter.put("date", date);
            postParameter.put("dateKind", dateKind);
            postParameter.put("keyword", keyword);
            postParameter.put("pageIndex", pageIndex + "");
            postParameter.put("pageSize", pageSize + "");

            System.out.println("response参数==" + new Gson().toJson(postParameter));

            OkHttpUtils.post().url(UrlAddress.GETPATIENTLISTINFO_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETPATIENTLIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<UserManagerInfo> result = GsonUtils.json2Object(response, UserManagerInfo.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETPATIENTLIST_SUCCESS, result));
                            } else {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETPATIENTLIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETPATIENTLIST_FAILURE);
                        }
                    } else {
                        mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETPATIENTLIST_FAILURE);
                    }
                }
            });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 患者监测类�?
     */
    public static void getMonitorKind(String departmentId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("departmentId", departmentId);
            OkHttpUtils.post().url(UrlAddress.MONITORKIND_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_MONITORKIND_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response==monitorkind==" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<MonitorKindWholeBean> result = GsonUtils.json2Object(response, MonitorKindWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_MONITORKIND_SUCCESS, result.getData().getList()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_MONITORKIND_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_MONITORKIND_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_MONITORKIND_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 症状/诊疗历史记录时间
     */
    public static void symptomRecordDates(String patientId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            OkHttpUtils.post().url(UrlAddress.SYMPTOMRECORDDATES_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_SYMPTOMRECORDDATES_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response==symptomRecordDates==" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<PatientHistoryDateWholeBean> result = GsonUtils.json2Object(response, PatientHistoryDateWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_SYMPTOMRECORDDATES_SUCCESS, result.getData().getList()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_SYMPTOMRECORDDATES_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_SYMPTOMRECORDDATES_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_SYMPTOMRECORDDATES_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 症状/诊疗历史记录
     */
    public static void symptomRecords(String patientId, String date, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            postParameter.put("date", date);
            OkHttpUtils.post().url(UrlAddress.SYMPTOMRECORDS_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_SYMPTOMRECORDS_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<PatientHistoryWholeBean> result = GsonUtils.json2Object(response, PatientHistoryWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_SYMPTOMRECORDS_SUCCESS, result.getData().getList()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_SYMPTOMRECORDS_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_SYMPTOMRECORDS_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_SYMPTOMRECORDS_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 基本信息历史记录时间
     */
    public static void basicInfoDates(String patientId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            OkHttpUtils.post().url(UrlAddress.BASICINFODATES_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_BASICINFODATES_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<PatientHistoryDateWholeBean> result = GsonUtils.json2Object(response, PatientHistoryDateWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_BASICINFODATES_SUCCESS, result.getData().getList()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_BASICINFODATES_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_BASICINFODATES_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_BASICINFODATES_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 基本信息历史记录
     */
    public static void basicInfos(String patientId, String date, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            postParameter.put("date", date);
            OkHttpUtils.post().url(UrlAddress.BASICINFOS_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_BASICINFOS_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<PatientHistoryWholeBean> result = GsonUtils.json2Object(response, PatientHistoryWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_BASICINFOS_SUCCESS, result.getData().getList()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_BASICINFOS_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_BASICINFOS_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_BASICINFOS_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 既往史历史记录时�?
     */
    public static void oldHistoryDates(String patientId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            OkHttpUtils.post().url(UrlAddress.OLDHISTORYDATES_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_OLDHISTORYDATES_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<PatientHistoryDateWholeBean> result = GsonUtils.json2Object(response, PatientHistoryDateWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_OLDHISTORYDATES_SUCCESS, result.getData().getList()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_OLDHISTORYDATES_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_OLDHISTORYDATES_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_OLDHISTORYDATES_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 既往史历史记�?
     */
    public static void oldHistorys(String patientId, String date, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            postParameter.put("date", date);
            OkHttpUtils.post().url(UrlAddress.OLDHISTORYS_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_OLDHISTORYS_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<PatientHistoryWholeBean> result = GsonUtils.json2Object(response, PatientHistoryWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_OLDHISTORYS_SUCCESS, result.getData().getList()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_OLDHISTORYS_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_OLDHISTORYS_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_OLDHISTORYS_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 用户执行单查�?
     *
     * @param orderType 单据类型e执行单r提醒�?
     */
    public static void doOrderUserList(int orderType, String patientId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            if (orderType == 0) {
                postParameter.put("orderType", "e");
            } else {
                postParameter.put("orderType", "r");
            }

            OkHttpUtils.post().url(UrlAddress.DOORDERUSERLIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOORDERUSERLIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<DolistWholeBean> result = GsonUtils.json2Object(response, DolistWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DOORDERUSERLIST_SUCCESS, result.getData().getDataList()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DOORDERUSERLIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOORDERUSERLIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOORDERUSERLIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }

    }

    /**
     * 用户执行单删�?
     */
    public static void doOrderDelete(String orderId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("orderId", orderId);
            OkHttpUtils.post().url(UrlAddress.DOORDERDELETE_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOORDERDELETE_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DOORDERDELETE_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DOORDERDELETE_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOORDERDELETE_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOORDERDELETE_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 用户执行单修�?新增
     */
    public static void doOrderEdit(String ListId, int ListType, String ListName, List<DolistEditFuncBean> ChildrenList, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
//            if (!TextUtils.isEmpty(ListId)) {
            postParameter.put("ListId", ListId);
//            }
            if (ListType == 0) {
                postParameter.put("ListType", "e");
            } else {
                postParameter.put("ListType", "r");
            }
            postParameter.put("ListName", ListName);
            postParameter.put("ChildrenList", ChildrenList);

            System.out.println("response=new Gson().toJson(postParameter)===" + new Gson().toJson(postParameter));

            OkHttpUtils.post().url(UrlAddress.DOORDEREDIT_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOORDEREDIT_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    response = response.replace("\"data\":\"\"", "\"data\":{}");
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<DoOrderEditResultBean> result = GsonUtils.json2Object(response, DoOrderEditResultBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DOORDEREDIT_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DOORDEREDIT_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOORDEREDIT_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOORDEREDIT_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 科室执行单列�?
     */
    public static void doOrderList(int orderType, String departmentId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("departmentId", departmentId);
            if (orderType == 0) {
                postParameter.put("orderType", "e");
            } else {
                postParameter.put("orderType", "r");
            }
            OkHttpUtils.post().url(UrlAddress.DOORDERLIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOORDERLIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<DepartmentOrderWholeBean> result = GsonUtils.json2Object(response, DepartmentOrderWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DOORDERLIST_SUCCESS, result.getData().getDataList()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DOORDERLIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOORDERLIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOORDERLIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }


    /**
     * 获取患者最近一天监测数�?
     */
    public static void getMonitorDayData(String patientId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            System.out.println(new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.MONITORDAYDATA_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    System.out.println("response====" + e.getMessage());
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETMONITORDAYDATA_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response==getMonitorDayData==" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<MyChartListBean> result = GsonUtils.json2Object(response, MyChartListBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETMONITORDAYDATA_SUCCESS, result));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETMONITORDAYDATA_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETMONITORDAYDATA_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETMONITORDAYDATA_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 科室执行单预�?
     */
    public static void doOrderView(String orderId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("orderId", orderId);
            OkHttpUtils.post().url(UrlAddress.DOORDERVIEW_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOORDERVIEW_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<DolistBean> result = GsonUtils.json2Object(response, DolistBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DOORDERVIEW_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DOORDERVIEW_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOORDERVIEW_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOORDERVIEW_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 科室执行单立即使�?定时使用
     */
    public static void doOrderUse(List<String> patientListId, String date, String orderId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientListId", patientListId);
            postParameter.put("date", date);
            postParameter.put("executionListId", orderId);
            System.out.println("response=postParameter===" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.DOORDERUSE_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOORDERUSE_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DOORDERUSE_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DOORDERUSE_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOORDERUSE_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOORDERUSE_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 科室列表
     */
    public static void getDepartmentList(final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            OkHttpUtils.post().url(UrlAddress.DEPARTMENTLIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_DEPARTMENTLIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<DepartmentWholeBean> result = GsonUtils.json2Object(response, DepartmentWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DEPARTMENTLIST_SUCCESS, result.getData().getList()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DEPARTMENTLIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_DEPARTMENTLIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_DEPARTMENTLIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 患者提醒日期列�?
     */
    public static void getRemindDateList(final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            OkHttpUtils.post().url(UrlAddress.PATIENTREMINDDATELIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTREMINDDATELIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<RemindDateListBean> result = GsonUtils.json2Object(response, RemindDateListBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTREMINDDATELIST_SUCCESS, result.getData().getList()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTREMINDDATELIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTREMINDDATELIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTREMINDDATELIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 量表给所选患者使�?
     */
    public static void scaleListUse(List<PatientIdBean> patients, String scaleId, String createTime, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patients", patients);
            postParameter.put("scaleId", scaleId);
            postParameter.put("createTime", createTime);
            System.out.println("new Gson().toJson(postParameter)====" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.SCALELISTUSE_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_SCALELISTUSE_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_SCALELISTUSE_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_SCALELISTUSE_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_SCALELISTUSE_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_SCALELISTUSE_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 调查问卷给所选患者使�?
     */
    public static void questionListUse(List<PatientIdBean> patients, String scaleId, String createTime, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patients", patients);
            postParameter.put("questionId", scaleId);
            postParameter.put("createTime", createTime);
            OkHttpUtils.post().url(UrlAddress.QUESTIONLISTUSE_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_SCALELISTUSE_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_QUESTIONLISTUSE_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_QUESTIONLISTUSE_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_QUESTIONLISTUSE_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_QUESTIONLISTUSE_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 患者提醒列�?
     */
    public static void getRemindList(String dateTime, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("dateTime", dateTime);
            System.out.println("response== new Gson().toJson(postParameter)==" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.PATIENTREMINDLIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTREMINDLIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response==getRemindList==" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<PatientRemindWholeBean> result = GsonUtils.json2Object(response, PatientRemindWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTREMINDLIST_SUCCESS, result.getData().getList()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTREMINDLIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTREMINDLIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTREMINDLIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 患者提醒列表添加记�?
     */
    public static void execOrder(String orderId) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("orderId", orderId);
            OkHttpUtils.post().url(UrlAddress.EXEC_ORDER_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {

                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response==execOrder==" + response);
                }
            });
        }
    }


    /**
     * 患者监测项录入
     */
    public static void patientMonitorAdd(String time, String kind, String testKind, List<MonitorInputValueBean> values, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("time", time);
            postParameter.put("kind", kind);//血压血�?
            postParameter.put("testKind", testKind);//餐前餐后
            postParameter.put("values", values);//valueid value
            OkHttpUtils.post().url(UrlAddress.PATIENTMONITORADD_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTMONITORADD_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response.replace("\"data\":\"\"", "\"data\":{}"));
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTMONITORADD_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTMONITORADD_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTMONITORADD_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTMONITORADD_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 患者监测项编辑
     */
    public static void patientMonitorEdit(String user_id, String time, String kind, String testKind, List<MonitorInputEditBean> values, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("user_id", user_id);
            postParameter.put("time", time);
            postParameter.put("kind", kind);//血压血�?
            postParameter.put("testKind", testKind);//餐前餐后
            postParameter.put("values", values);//valueid value
            System.out.println("response====" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.PATIENTMONITOREDIT_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTMONITOREDIT_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTMONITOREDIT_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTMONITOREDIT_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTMONITOREDIT_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTMONITOREDIT_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }


    /**
     * 量表列表
     */
    public static void getScaleList(String user_id, int pageIndex, int pageSize, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("user_id", user_id);
            postParameter.put("pageIndex", pageIndex + "");
            postParameter.put("pageSize", pageSize + "");
            OkHttpUtils.post().url(UrlAddress.SCALELIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETSCALELIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<ScaleBean> result = GsonUtils.json2Object(response, ScaleBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETSCALELIST_SUCCESS, result));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETSCALELIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETSCALELIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETSCALELIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 调查问卷列表
     */
    public static void getQuestionList(String user_id, int pageIndex, int pageSize, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("user_id", user_id);
            postParameter.put("pageIndex", pageIndex + "");
            postParameter.put("pageSize", pageSize + "");
            OkHttpUtils.post().url(UrlAddress.QUESTIONLIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETQUESTIONLIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<QuestionBean> result = GsonUtils.json2Object(response, QuestionBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETQUESTIONLIST_SUCCESS, result));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETQUESTIONLIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETQUESTIONLIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETQUESTIONLIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 患者时段内监测数据
     */
    public static void getMonitorData(String patientId, String periodType, String kindId, String testId, String date, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            postParameter.put("periodType", periodType);
            postParameter.put("kindId", kindId);
            postParameter.put("testId", testId);
            postParameter.put("date", date);
            System.out.println("response==postParameter===" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.MONITORDATA_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETMONITORDATA_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response==getMonitorData==" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<LineListBean> result = GsonUtils.json2Object(response, LineListBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETMONITORDATA_SUCCESS, result));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETMONITORDATA_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETMONITORDATA_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETMONITORDATA_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 监测项编�?
     */
    public static void editMonitorData(String monitorId, String time, String kind, String testKind, List<MonitorBean> values, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);

            postParameter.put("monitorId", monitorId);
            postParameter.put("time", time);
            postParameter.put("kind", kind);
            postParameter.put("testKind", testKind);
            postParameter.put("values", values);
            OkHttpUtils.post().url(UrlAddress.MONITOREDIT_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETMONITOREDIT_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2Result(response, BaseResultBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETMONITOREDIT_SUCCESS, result));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETMONITOREDIT_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETMONITOREDIT_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETMONITOREDIT_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 监测项删�?
     */
    public static void getMonitorDelete(List<String> pointsId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("pointIds", pointsId);
            System.out.println("pointIds====" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.MONITORDELETE_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETMONITORDELETE_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2Result(response, BaseResultBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETMONITORDELETE_SUCCESS, result));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETMONITORDELETE_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETMONITORDELETE_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETMONITORDELETE_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }


    /**
     * 监测提醒列表（医护端�?
     */
    public static void getNurseMonitor(int pageIndex, int pageSize, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("pageIndex", pageIndex + "");
            postParameter.put("pageSize", pageSize + "");
            OkHttpUtils.post().url(UrlAddress.GETNURSEMONITOR_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETNURSEMONITOR_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response==GETNURSEMONITOR==" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<NurseMonitorWholeBean> result = GsonUtils.json2Object(response, NurseMonitorWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETNURSEMONITOR_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETNURSEMONITOR_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETNURSEMONITOR_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETNURSEMONITOR_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 评估提醒列表（医护端�?
     */
    public static void getNurseAssess(int pageIndex, int pageSize, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("pageIndex", pageIndex + "");
            postParameter.put("pageSize", pageSize + "");
            OkHttpUtils.post().url(UrlAddress.GETNURSEASSESS_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETNURSEASSESS_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<NurseMonitorWholeBean> result = GsonUtils.json2Object(response, NurseMonitorWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETNURSEASSESS_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETNURSEASSESS_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETNURSEASSESS_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETNURSEASSESS_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 评估提醒列表（患者端�?
     */
    public static void getPatientAssess(int pageIndex, int pageSize, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("pageIndex", pageIndex + "");
            postParameter.put("pageSize", pageSize + "");
            OkHttpUtils.post().url(UrlAddress.GETPATIENTASSESS_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETPATIENTASSESS_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<PatientAssessWholeBean> result = GsonUtils.json2Object(response, PatientAssessWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETPATIENTASSESS_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETPATIENTASSESS_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETPATIENTASSESS_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETPATIENTASSESS_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 系统消息列表
     */
    public static void getSystemMsg(int pageIndex, int pageSize, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("pageIndex", pageIndex + "");
            postParameter.put("pageSize", pageSize + "");
            OkHttpUtils.post().url(UrlAddress.GETSYSTEMMSG_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETSYSTEMMSG_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response===res=" + response);
                    Log.i("---response----->",response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<SystemMsgWholeBean> result = GsonUtils.json2Object(response, SystemMsgWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETSYSTEMMSG_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETSYSTEMMSG_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETSYSTEMMSG_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETSYSTEMMSG_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }


    /**
     * 患者评估记录列�?
     */

    public static void delUserQuestion(String userQuestionId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("userQuestionId", userQuestionId);
            OkHttpUtils.post().url(UrlAddress.DELETEUSERQUESTION_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_DELETEUSERQUESTION_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response=delUserQuestion===" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2Result(response, BaseResultBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DELETEUSERQUESTION_SUCCESS, result));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DELETEUSERQUESTION_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_DELETEUSERQUESTION_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_DELETEUSERQUESTION_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 患者评估记录列�?
     */
    public static void getAssessRecord(String patientId, String type, int pageIndex, int pageSize, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            postParameter.put("type", type);
            postParameter.put("pageIndex", pageIndex + "");
            postParameter.put("pageSize", pageSize + "");
            System.out.println("getAssessRecord==postParameter=" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.GETASSESSRECORD_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETASSESSRECORD_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response=getAssessRecord===" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<AssessRecordWholeBean> result = GsonUtils.json2Object(response, AssessRecordWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETASSESSRECORD_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETASSESSRECORD_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETASSESSRECORD_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETASSESSRECORD_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }


    /**
     * 患者评估反�?
     */
    public static void getAssessFeedbackUser(String questionUserId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("answerId", questionUserId);
            System.out.println("response==new Gson().toJson(postParameter)==" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.GETASSESSFEEDBACKUSER_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETASSESSFEEDBACKUSER_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<AssessFeedbackBean> result = GsonUtils.json2Object(response, AssessFeedbackBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETASSESSFEEDBACKUSER_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETASSESSFEEDBACKUSER_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETASSESSFEEDBACKUSER_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETASSESSFEEDBACKUSER_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }


    /**
     * 患者评估反�?
     */
    public static void getAssessFeedback(String patientId, String assessId, String questionUserId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            postParameter.put("assessId", assessId);
            postParameter.put("answerId", questionUserId);
            System.out.println("response==new Gson().toJson(postParameter)==" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.GETASSESSFEEDBACK_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETASSESSFEEDBACK_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response==1111111111111==" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<AssessFeedbackBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), AssessFeedbackBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETASSESSFEEDBACK_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETASSESSFEEDBACK_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETASSESSFEEDBACK_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETASSESSFEEDBACK_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 删除我的检查报�?
     */
    public static void deleteMyInspectionReport(String InspectionReportId, String patientId, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("InspectionReportId", InspectionReportId);
            postParameter.put("patientId", patientId);
            OkHttpUtils.post().url(UrlAddress.DELETEMYINSPECTIONREPORT_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_DELETEMYINSPECTIONREPORT_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_DELETEMYINSPECTIONREPORT_SUCCESS, result.getMessage()));
                            } else {
                                mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_DELETEMYINSPECTIONREPORT_FAILURE, result.getMessage()));
                            }
                        } else {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_DELETEMYINSPECTIONREPORT_FAILURE);
                        }
                    } else {
                        mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_DELETEMYINSPECTIONREPORT_FAILURE);
                    }
                }
            });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 根据手机号获取个人信�?
     */
    public static void getUserInfo(List<String> tels, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("tels", tels);
            OkHttpUtils.post().url(UrlAddress.GETUSERINFO_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETUSERINFO_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<UserInfoWholeBean> result = GsonUtils.json2Object(response, UserInfoWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETUSERINFO_SUCCESS, result.getData().getList()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETUSERINFO_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETUSERINFO_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETUSERINFO_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 患者提醒时间列�?
     */
    public static void getRemindTimeList(final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            OkHttpUtils.post().url(UrlAddress.GETREMINDTIMELIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETREMINDTIMELIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("getRemindTimeList====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<RemindTimeBean> result = GsonUtils.json2Object(response, RemindTimeBean.class);
//                        Log.i("---DDD->","result:"+result.toString());
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                Log.i("--TTT-->","======AAAA========"+result.getData().toString());
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETREMINDTIMELIST_SUCCESS, result.getData()));
                            } else {
                                Log.e("getRemindTimeListFail", "onResponse: " + result.getMessage());
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETREMINDTIMELIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETREMINDTIMELIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETREMINDTIMELIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 是否有新消息
     */
    public static void checkNewMsg(final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            OkHttpUtils.post().url(UrlAddress.CHECKNEWMSG_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_CHECKNEWMSG_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<CheckNewMsgWholeBean> result = GsonUtils.json2Object(response, CheckNewMsgWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_CHECKNEWMSG_SUCCESS, result.getData().getList()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_CHECKNEWMSG_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CHECKNEWMSG_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_CHECKNEWMSG_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * reset
     *
     * @param mHandler
     */
    public static void getCodeReset(String tel, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("tel", tel);

            OkHttpUtils.post().url(UrlAddress.GETCODERESET_URl)
                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(
                    new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETCODERESET_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response====" + response);
                            if (!TextUtils.isEmpty(response)) {

                                ObjectResultBean<VerCodeInfo> result = GsonUtils.json2Object(response, VerCodeInfo.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETCODERESET_SUCCESS, result));

                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETCODERESET_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETCODERESET_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETCODERESET_FAILURE);
                            }
                        }
                    }
            );
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 护士与患者聊�?
     */
    public static void userTalking(String patientId, Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);

            OkHttpUtils.post().url(UrlAddress.USERTALKING_URL)
                    .addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    System.out.println("userTalking:fail");
//                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_USERTALKING_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                System.out.println("userTalking:success");
                            } else {
                                System.out.println("userTalking:fail");
                            }
                        } else {
                            System.out.println("userTalking:fail");
                        }
                    } else {
                        System.out.println("userTalking:fail");
                    }
                }
            });
        } else {
//            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 最近有检查报告记录的的月�?
     */
    public static void getLastReportMonth(final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            OkHttpUtils.post().url(UrlAddress.LASTINSPECTIONREPORTMONTH_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_LASTINSPECTIONREPORTMONTH_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<LastReportMonthBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), LastReportMonthBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_LASTINSPECTIONREPORTMONTH_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_LASTINSPECTIONREPORTMONTH_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_LASTINSPECTIONREPORTMONTH_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_LASTINSPECTIONREPORTMONTH_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 登录用户绑定的用�?
     */
    public static void getBindingUsers(final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            OkHttpUtils.post().url(UrlAddress.BINDINGUSERS_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_BINDINGUSERS_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<BindingUsersBean> result = GsonUtils.json2Object(response, BindingUsersBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_BINDINGUSERS_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_BINDINGUSERS_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_BINDINGUSERS_FAILURE);
                        }

                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_BINDINGUSERS_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 版本更新
     */
    public static void getVersion(final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("appType", "2");
            OkHttpUtils.post().url(UrlAddress.GETVERSION_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETVERSION_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<VersionBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), VersionBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETVERSION_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETVERSION_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETVERSION_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETVERSION_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 医生分组列表
     */
    public static void getDoctorGroupList(String departmentId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("departmentId", departmentId);
            OkHttpUtils.post().url(UrlAddress.GETDOCTORGROULIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETDOCTORGROULIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    //{"code":0,"data":{"list":[{"groupId":4,"name":"分组1"},{"groupId":5,"name":"分组2"},{"groupId":6,"name":"三组"},{"groupId":7,"name":"四组"},{"groupId":8,"name":"五组"},{"groupId":9,"name":"六组"}]},"message":"医生分组列表请求成功�?}
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<DoctorGroupWholeBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), DoctorGroupWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETDOCTORGROULIST_SUCCESS, result.getData().getList()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETDOCTORGROULIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETDOCTORGROULIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETVERSION_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 患者加入分�?
     */
    public static void userJoinDoctorGroup(String groupId, String patientId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("groupId", groupId);
            postParameter.put("patientId", patientId);
            OkHttpUtils.post().url(UrlAddress.USERJOINDOCTORGROUP_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_USERJOINDOCTORGROUP_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response.replace("data\":\"\"", "data\":{}"));
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_USERJOINDOCTORGROUP_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_USERJOINDOCTORGROUP_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_USERJOINDOCTORGROUP_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_USERJOINDOCTORGROUP_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 修改患者出院时间、复诊时�?
     */
    public static void hospitalTimeUpdate(String cyId, String cyTime, String fzId, String fzTime, String patientId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            postParameter.put("cyId", cyId);
            postParameter.put("cyTime", cyTime);
            postParameter.put("fzId", fzId);
            postParameter.put("fzTime", fzTime);
            System.out.println(" new Gson().toJson(postParameter)====" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.HOSPITALTIMEUPDATE_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_HOSPITALTIMEUPDATE_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response.replace("data\":\"\"", "data\":{}"));
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_HOSPITALTIMEUPDATE_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_HOSPITALTIMEUPDATE_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_HOSPITALTIMEUPDATE_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_HOSPITALTIMEUPDATE_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 患者服药记�?
     */
    public static void takeDrugsRecord(String patientId, int pageIndex, int pageSize, String drugId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            postParameter.put("pageIndex", pageIndex);
            postParameter.put("pageSize", pageSize);
            postParameter.put("drugId", drugId);
            OkHttpUtils.post().url(UrlAddress.TAKEDRUGSRECORD_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_TAKEDRUGSRECORD_FAILURE);
                }

                @Override
                public void onResponse(String response) {//{"code":0,"data":[{"date":"2016-10-10","list":[{"recordId":12,"timeList":["07:00","15:00","23:00"],"drugList":[{"doseId":3,"drugName":"华法林钠�?,"drugId":2,"doseName":"2.5mg"}]}]}],"message":"ok"}
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<TakeDrugsRecordWholeBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), TakeDrugsRecordWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_TAKEDRUGSRECORD_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_TAKEDRUGSRECORD_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_TAKEDRUGSRECORD_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_TAKEDRUGSRECORD_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }


    /**
     * 患者停药记录
     */
    public static void stopDrugsRecord(String patientId, int pageIndex, int pageSize,final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            postParameter.put("pageIndex", pageIndex);
            postParameter.put("pageSize", pageSize);
            OkHttpUtils.post().url(UrlAddress.STOPDRUGSRECORD_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_STOPDRUGSRECORD_FAILURE);
                }

                @Override
                public void onResponse(String response) {//{"code":0,"data":[{"date":"2016-10-10","list":[{"recordId":12,"timeList":["07:00","15:00","23:00"],"drugList":[{"doseId":3,"drugName":"华法林钠�?,"drugId":2,"doseName":"2.5mg"}]}]}],"message":"ok"}
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<StopDrugsRecordWholeBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), StopDrugsRecordWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_STOPDRUGSRECORD_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_STOPDRUGSRECORD_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_STOPDRUGSRECORD_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_STOPDRUGSRECORD_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }



    /**
     * 药品列表
     */
    public static void drugsList(String departmentId,String userID,final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("departmentId", departmentId);
            //新增patientID
            postParameter.put("userId",userID);
            OkHttpUtils.post().url(UrlAddress.DRUGSLIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_DRUGSLIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<DrugsList> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), DrugsList.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DRUGSLIST_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DRUGSLIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_DRUGSLIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_DRUGSLIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }
    /*
   *
   *添加修改新药
   *
   * */
    public static void addNewDrugsUpdate(String medicineId,String recordId,String departmentId,String dose, String medicineUnit,String medicineName, List<String> timeList,String date, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("medicineId",medicineId);
            postParameter.put("recordId",recordId);
            postParameter.put("departmentId",departmentId);
            postParameter.put("dose",dose);
            postParameter.put("medicineUnit",medicineUnit);
            postParameter.put("medicineName",medicineName);
            postParameter.put("timeList", timeList);
            postParameter.put("date", date);
            OkHttpUtils.post().url(UrlAddress.ADDNEWDRUGS_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDNEWDRUGSUPDATE_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response.replace("data\":\"\"", "data\":{}"));
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_ADDNEWDRUGSUPDATE_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_ADDNEWDRUGSUPDATE_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDNEWDRUGSUPDATE_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDNEWDRUGSUPDATE_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }
    /*
    *
    *添加新药
    *
    * */
    public static void addNewDrugs(String departmentId,String dose, String medicineUnit,String medicineName, List<String> timeList,String date, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("departmentId",departmentId);
            postParameter.put("dose",dose);
            postParameter.put("medicineUnit",medicineUnit);
            postParameter.put("medicineName",medicineName);
            postParameter.put("timeList", timeList);
            postParameter.put("date", date);
            OkHttpUtils.post().url(UrlAddress.ADDNEWDRUGS_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDNEWDRUGS_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response.replace("data\":\"\"", "data\":{}"));
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_ADDNEWDRUGS_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_ADDNEWDRUGS_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDNEWDRUGS_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDNEWDRUGS_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }
    /**
     * 添加/修改服药记录
     */
    public static void addTakeDrugs(List<AddDrugBean> drugList, String date, String recordId, List<String> timeList, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("drugList", drugList);
            postParameter.put("date", date);
            if (!TextUtils.isEmpty(recordId)) {
                postParameter.put("recordId", recordId);
            }
            postParameter.put("timeList", timeList);
            OkHttpUtils.post().url(UrlAddress.ADDTAKEDRUGS_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDTAKEDRUGS_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response.replace("data\":\"\"", "data\":{}"));
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_ADDTAKEDRUGS_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_ADDTAKEDRUGS_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDTAKEDRUGS_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDTAKEDRUGS_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 添加停药记录
     */
    public static void addStopTakeDrugs(String userId,String recordId ,String drugId, String date,String content, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("userId", userId);
            postParameter.put("drugId", drugId);
            postParameter.put("date", date);
            postParameter.put("recordId",recordId);
            postParameter.put("content", content);
            OkHttpUtils.post().url(UrlAddress.ADDSTOPDRUGS_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDSTOPTAKEDRUGS_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response.replace("data\":\"\"", "data\":{}"));
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_ADDSTOPTAKEDRUGS_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_ADDSTOPTAKEDRUGS_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDSTOPTAKEDRUGS_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDSTOPTAKEDRUGS_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }





    /**
     * 删除服药记录
     */
    public static void deleteTakeDrugs(String recordId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("recordId", recordId);
            OkHttpUtils.post().url(UrlAddress.DELETETAKEDRUGS_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_DELETETAKEDRUGS_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response.replace("data\":\"\"", "data\":{}"));
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DELETETAKEDRUGS_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DELETETAKEDRUGS_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_DELETETAKEDRUGS_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_DELETETAKEDRUGS_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }

    }


    /**
     * 删除停药记录
     */
    public static void deleteStopDrugs(String recordId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("recordId", recordId);
            OkHttpUtils.post().url(UrlAddress.DELETESTOPDRUGS_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_DELETESTOPDRUGS_FAILURE);
                }
                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response.replace("data\":\"\"", "data\":{}"));
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DELETESTOPDRUGS_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DELETESTOPDRUGS_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_DELETESTOPDRUGS_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_DELETESTOPDRUGS_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }

    }




    /**
     * 科室医生列表
     */
    public static void getDoctorList(String departmentId, int pageIndex, int pageSize, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("departmentId", departmentId);
            postParameter.put("pageIndex", pageIndex);
            postParameter.put("pageSize", pageSize);
            OkHttpUtils.post().url(UrlAddress.DOCTORLIST_URL)
                    .addParams("Data", new Gson().toJson(postParameter)).build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETDEPARTMENTDOCTORLIST_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response==getNurseList==" + response);
                            if (!TextUtils.isEmpty(response)) {
                                ObjectResultBean<NurseWholeBean> result = GsonUtils.json2Object(response, NurseWholeBean.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETDEPARTMENTDOCTORLIST_SUCCESS, result.getData()));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETDEPARTMENTDOCTORLIST_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETDEPARTMENTDOCTORLIST_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_GETDEPARTMENTDOCTORLIST_FAILURE);
                            }
                        }
                    });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 患者端 医生评价列表
     */
    public static void getDoctorAssessList(int pageIndex, int pageSize, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("pageIndex", pageIndex);
            postParameter.put("pageSize", pageSize);
            OkHttpUtils.post().url(UrlAddress.DOCTORASSESS_URL)
                    .addParams("Data", new Gson().toJson(postParameter)).build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOCTORASSESS_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            System.out.println("response==" + response);
                            if (!TextUtils.isEmpty(response)) {
                                ObjectResultBean<DoctorAssessWholeBean> result = GsonUtils.json2Object(response, DoctorAssessWholeBean.class);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DOCTORASSESS_SUCCESS, result.getData()));
                                    } else {
                                        handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DOCTORASSESS_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOCTORASSESS_FAILURE);
                                }
                            } else {
                                handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOCTORASSESS_FAILURE);
                            }
                        }
                    });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }


    /**
     * 我的检查报告列�?
     */
    public static void getMyReportList(final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            System.out.println("new Gson().toJson(postParameter)====" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.MYREPORTLIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_MYREPORTLIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<MyReportListBean> result = GsonUtils.json2Object(response, MyReportListBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_MYREPORTLIST_SUCCESS, result));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_MYREPORTLIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_MYREPORTLIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_MYREPORTLIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 录入修改检查报�?
     */
    public static void updateMyReport(String reportId, String time, String value, String pic, String valueId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("reportId", reportId);
            postParameter.put("time", time);
            postParameter.put("value", value);
            postParameter.put("pic", pic);
            postParameter.put("valueId", valueId);
            System.out.println("new Gson().toJson(postParameter)====" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.UPDATMYEREPORT_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_UPDATEMYREPORT_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2Result(response, BaseResultBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_UPDATEMYREPORT_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_UPDATEMYREPORT_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_UPDATEMYREPORT_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_UPDATEMYREPORT_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 删除检查报�?
     */
    public static void deleteMyReport(String valueId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("valueId", valueId);
            System.out.println("new Gson().toJson(postParameter)====" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.DELETEMYEREPORT_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_DELETEMYREPORT_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2Result(response, BaseResultBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DELETEMYREPORT_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DELETEMYREPORT_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_DELETEMYREPORT_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_DELETEMYREPORT_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }


    /**
     * 获取残疾程度列表
     */
    public static void getDisabilityList(String departmentId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("departmentId", departmentId);
            System.out.println("new Gson().toJson(postParameter)====" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.DISABILITYLIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_DISABILITYLIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<DisabilityListBean> result = GsonUtils.json2Object(response, DisabilityListBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DISABILITYLIST_SUCCESS, result));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DISABILITYLIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_DISABILITYLIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_DISABILITYLIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 医生管理列表
     */
    public static void getDocotrPatientList(String groupId, String disabilityId, String fzDate, String keyword, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("groupId", groupId);
            postParameter.put("disabilityId", disabilityId);
            postParameter.put("fzDate", fzDate);
            postParameter.put("keyword", keyword);
            System.out.println("new Gson().toJson(postParameter)====" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.DOCTORPATIENTLIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOCTORPATIENTLIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<DoctorPatientResultBean> result = GsonUtils.json2Object(response, DoctorPatientResultBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DOCTORPATIENTLIST_SUCCESS, result));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_DOCTORPATIENTLIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOCTORPATIENTLIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_DOCTORPATIENTLIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 患者各类检测记录列�?
     */
    public static void patientUsedList(String patientId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            OkHttpUtils.post().url(UrlAddress.PATIENTUSEDLIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTUSEDLIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    //{"code":0,"data":{"assessReportList":[{"itemId":2,"itemName":"甘油三酯(TG)"}],"questionList":[],"speciallyAssessList":[{"itemId":2954,"itemName":"健康心理控制源量�?},{"itemId":2951,"itemName":"广泛性焦虑自评表（GAD-7�?},{"itemId":2948,"itemName":"洼田饮水实验"},{"itemId":18,"itemName":"肌力分级"},{"itemId":12,"itemName":"日常生活活动能力评估�?},{"itemId":11,"itemName":"Braden成人压疮评估�?}],"patientInfoList":[{"itemId":1,"itemName":"症状诊疗"}],"monitorList":[{"itemId":7,"itemName":"血�?}],"drugList":[{"itemId":2,"itemName":"华法林钠�?}]},"message":"ok"}
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<DpatientInfoWholeBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), DpatientInfoWholeBean.class);
                        if (result != null) {
                            if (SUCCESS.equals(result.getCode())) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTUSEDLIST_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTUSEDLIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTUSEDLIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTUSEDLIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 提交康复评价
     */
    public static void addPatientEvalution(String patientId, String content, String voiceUrl, String voiceLength, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            postParameter.put("content", content);
            postParameter.put("voiceUrl", voiceUrl);
            postParameter.put("voiceLength", voiceLength);
            OkHttpUtils.post().url(UrlAddress.ADDPATIENTEVALUTION_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDPATIENTEVALUTION_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response.replace("data\":\"\"", "data\":{}"));
                        if (result != null) {
                            if (SUCCESS.equals(result.getCode())) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_ADDPATIENTEVALUTION_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_ADDPATIENTEVALUTION_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDPATIENTEVALUTION_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_ADDPATIENTEVALUTION_FAILURE);
                    }
                }
            });

        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 患者康复评价列�?
     */
    public static void patientEvalutionList(String patientId, int pageIndex, int pageSize, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            postParameter.put("pageIndex", pageIndex);
            postParameter.put("pageSize", pageSize);
            OkHttpUtils.post().url(UrlAddress.PATIENTEVALUTIONLIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTEVALUTIONLIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<PatientEvalutionWholeBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), PatientEvalutionWholeBean.class);
                        if (result != null) {
                            if (SUCCESS.equals(result.getCode())) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTEVALUTIONLIST_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTEVALUTIONLIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTEVALUTIONLIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTEVALUTIONLIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 康复评价删除
     */
    public static void patientEvalutionDelete(String evaluationId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("evaluationId", evaluationId);
            OkHttpUtils.post().url(UrlAddress.PATIENTEVALUTIONDELETE_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTEVALUTIONDELETE_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response.replace("data\":\"\"", "data\":{}"));
                        if (result != null) {
                            if (SUCCESS.equals(result.getCode())) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTEVALUTIONDELETE_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTEVALUTIONDELETE_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTEVALUTIONDELETE_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTEVALUTIONDELETE_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 专科评估（调查问卷）得分列表
     */
    public static void assessScoreList(String patientId, String assessId, int pageIndex, int pageSize, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            postParameter.put("assessId", assessId);
            postParameter.put("pageIndex", pageIndex);
            postParameter.put("pageSize", pageSize);
            OkHttpUtils.post().url(UrlAddress.ASSESSSCORELIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_ASSESSSCORELIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<AssessScoreWholeBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), AssessScoreWholeBean.class);
                        if (result != null) {
                            if (SUCCESS.equals(result.getCode())) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_ASSESSSCORELIST_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_ASSESSSCORELIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_ASSESSSCORELIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_ASSESSSCORELIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 检查报告详�?
     */
    public static void getMyreportDetail(String patientId, String reportId, String startTime, String endTime, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            postParameter.put("reportId", reportId);
            postParameter.put("startTime", startTime);
            postParameter.put("endTime", endTime);
            System.out.println("new Gson().toJson(postParameter)====" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.MYREPORTDETAIL_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_MYREPORTDETAIL_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response==getMyreportDetail==" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<MyReportValueBean> result = GsonUtils.json2Object(response, MyReportValueBean.class);
                        if (result != null) {
                            if (SUCCESS.equals(result.getCode())) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_MYREPORTDETAIL_SUCCESS, result));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_MYREPORTDETAIL_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_MYREPORTDETAIL_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_MYREPORTDETAIL_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 患者基本信息、症状诊疗、既往史修改记录列�?
     */
    public static void patientBasicinfoList(String patientId, String type, int pageIndex, int pageSize, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            postParameter.put("type", type);
            postParameter.put("pageIndex", pageIndex);
            postParameter.put("pageSize", pageSize);
            OkHttpUtils.post().url(UrlAddress.PATIENTBASICINFOLIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTBASICINFOLIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<BasicinfosWholeBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), BasicinfosWholeBean.class);
                        if (result != null) {
                            if (SUCCESS.equals(result.getCode())) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTBASICINFOLIST_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTBASICINFOLIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTBASICINFOLIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTBASICINFOLIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 获取患者自己的病案�?
     */
    public static void patientCaseNumber(final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            OkHttpUtils.post().url(UrlAddress.PATIENTCASENUMBER_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTCASENUMBER_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<PatientCaseNumberBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), PatientCaseNumberBean.class);
                        if (result != null) {
                            if (SUCCESS.equals(result.getCode())) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTCASENUMBER_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_PATIENTCASENUMBER_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTCASENUMBER_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_PATIENTCASENUMBER_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 筛选类�?
     */
    public static void getPatientFilterList(String departmentId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("departmentId", departmentId);
            System.out.println("response==getPatientFilterList==" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.PATIENTFILTERLIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.PREGNANTBMIADD_GETPATIENTFILTERLIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response==getPatientFilterList==" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<FilterListBean> result = GsonUtils.json2Object(response, FilterListBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.PREGNANTBMIADD_GETPATIENTFILTERLIST_SUCCESS, result));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.PREGNANTBMIADD_GETPATIENTFILTERLIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.PREGNANTBMIADD_GETPATIENTFILTERLIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.PREGNANTBMIADD_GETPATIENTFILTERLIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.PREGNANTBMIADD_GETPATIENTFILTERLIST_FAILURE);
        }
    }


    /**
     * 新筛选类别下的患者列�?
     */
    public static void getPatientFilterResultList(List<FilterPatientBean> filterList, String needAll, String keyword, int pageIndex, int pageSize, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("needAll", needAll);
            postParameter.put("filterList", filterList);
            postParameter.put("keyword", keyword);
            postParameter.put("pageIndex", pageIndex);
            postParameter.put("pageSize", pageSize);
            System.out.println("new Gson().toJson(postParameter)==getPatientFilterResultList==" + new Gson().toJson(postParameter));
            OkHttpUtils.post().url(UrlAddress.PATIENTNEWLIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.PREGNANTBMIADD_GETPATIENTFILTERNEWLIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response==getPatientFilterResultList==" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<UserManagerInfo> result = GsonUtils.json2Object(response, UserManagerInfo.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.PREGNANTBMIADD_GETPATIENTFILTERNEWLIST_SUCCESS, result));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.PREGNANTBMIADD_GETPATIENTFILTERNEWLIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.PREGNANTBMIADD_GETPATIENTFILTERNEWLIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.PREGNANTBMIADD_GETPATIENTFILTERNEWLIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 康复计划单新建、修�?
     */
    public static void betterPlanCreate(String listName, String listId, List<String> patientIds, List<BetterPlanEditBean> childrenList, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("listName", listName);
            postParameter.put("listId", listId);
            postParameter.put("patientIds", patientIds);
            postParameter.put("ChildrenList", childrenList);
            OkHttpUtils.post().url(UrlAddress.BETTERPLANCREATE_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.PREGNANTBMIADD_BETTERPLANCREATE_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("response====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        BaseResultBean result = GsonUtils.json2BaseBean(response.replace("data\":\"\"", "data\":{}"));
                        if (result != null) {
                            if (SUCCESS.equals(result.getCode())) {
                                handler.sendMessage(createMsg(MessageCode.PREGNANTBMIADD_BETTERPLANCREATE_SUCCESS, result.getMessage()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.PREGNANTBMIADD_BETTERPLANCREATE_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.PREGNANTBMIADD_BETTERPLANCREATE_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.PREGNANTBMIADD_BETTERPLANCREATE_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 康复计划单列�?
     */
    public static void betterPlanList(String patientId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("patientId", patientId);
            OkHttpUtils.post().url(UrlAddress.BETTERPLANLIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.PREGNANTBMIADD_BETTERPLANLIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<BetterPlanWholeBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), BetterPlanWholeBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.PREGNANTBMIADD_BETTERPLANLIST_SUCCESS, result.getData().getDataList()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.PREGNANTBMIADD_BETTERPLANLIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.PREGNANTBMIADD_BETTERPLANLIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.PREGNANTBMIADD_BETTERPLANLIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 康复方案详情
     */
    public static void betterPlanDetail(String orderId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("orderId", orderId);
            OkHttpUtils.post().url(UrlAddress.BETTERPLANDETAIL_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.PREGNANTBMIADD_BETTERPLANDETAIL_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<BetterPlanEditDetailBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), BetterPlanEditDetailBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.PREGNANTBMIADD_BETTERPLANDETAIL_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.PREGNANTBMIADD_BETTERPLANDETAIL_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.PREGNANTBMIADD_BETTERPLANDETAIL_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.PREGNANTBMIADD_BETTERPLANDETAIL_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 护士端获取未读消�?
     */
    public static void checkNurseNewMsg(final IResponseNewMsgInfoListener responseNewMsgInfoListener) {
        if (WebUtils.isConnected()) {
            instance(true);
            OkHttpUtils.post().url(UrlAddress.CHECK_NEWMSG).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                }

                @Override
                public void onResponse(String response) {
                    if (!TextUtils.isEmpty(response)) {
                        System.out.println("checkNurseNewMsg====" + response);
                        ObjectResultBean<UserMsgBean> result = GsonUtils.json2Object(response, UserMsgBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                if (responseNewMsgInfoListener!=null){
                                    responseNewMsgInfoListener.responseInfo(result.getData());
                                }
                            }
                        }
                    }
                }
            });
        }
    }

    /**
     * 咨询页面小红点消息
     */
    public static void checkConsultNewMsg(String userId, final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("userId", userId);
            OkHttpUtils.post().url(UrlAddress.CHECKCONSULTMSG_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_CHECKCONSULTMSG_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    if (!TextUtils.isEmpty(response)) {
                        System.out.println("checkConsultNewMsg====" + response);
                        ObjectResultBean<ConsultMsgShowBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), ConsultMsgShowBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_CHECKCONSULTMSG_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_CHECKCONSULTMSG_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CHECKCONSULTMSG_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_CHECKCONSULTMSG_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 支付列表
     */
    public static void getUserDoctorPriceList(final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);

            postParameter.put(null,null);
            OkHttpUtils.post().url(UrlAddress.GET_WZUSERDOCTORPRICELIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_WZUSERDOCTORPRICELIST_FAILURE);
                }
                @Override
                public void onResponse(String response) {
                    if (!TextUtils.isEmpty(response)) {
                        System.out.println("WZUSERDOCTORPRICELIST====" + response);
                        ObjectResultBean<DoctorPriceListBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), DoctorPriceListBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_WZUSERDOCTORPRICELIST_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_WZUSERDOCTORPRICELIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_WZUSERDOCTORPRICELIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_WZUSERDOCTORPRICELIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 微信支付
     */
    public static void weiXinPay(String userId,String mercid,String cashnum, String commodity,final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("userId", userId);
            postParameter.put("mercid", mercid);
            postParameter.put("cashnum", cashnum);
            postParameter.put("commoditys", commodity);

            OkHttpUtils.post().url(UrlAddress.CHECK_WEIXINPAY).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_WEIXINPAY_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("weixinpay====" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<WeiXinPayBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), WeiXinPayBean.class);
                       // System.out.println("weixinpay====" + result.toString());
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_WEIXINPAY_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_WEIXINPAY_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_WEIXINPAY_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_WEIXINPAY_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }
        /**
         * 微信支付订单
         */
    public static void GetUserOrder(String out_trade_no,final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("out_trade_no", out_trade_no);

            OkHttpUtils.post().url(UrlAddress.GET_USERORDER).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETUSERORDER_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("==userorder==" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<OrderListBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), OrderListBean.class);
                      //  System.out.println("==userorder==" + result.toString());
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETUSERORDER_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETUSERORDER_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETUSERORDER_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETUSERORDER_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 微信支付成功订单列表
     */
    public static void GetUserOrderList(String userId,int pageIndex,int pageSize,final Handler handler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("userId",userId);
            postParameter.put("pageIndex",pageIndex);
            postParameter.put("pageSize",pageSize);
            OkHttpUtils.post().url(UrlAddress.GET_USERORDERLIST_URL).addParams("Data", new Gson().toJson(postParameter))
                    .build().execute(new StringCallback() {
                @Override
                public void onError(Call call, Exception e) {
                    handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETUSERORDERLIST_FAILURE);
                }

                @Override
                public void onResponse(String response) {
                    System.out.println("==userorderlist==" + response);
                    if (!TextUtils.isEmpty(response)) {
                        ObjectResultBean<OrderListBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), OrderListBean.class);
                        if (result != null) {
                            if (result.getCode().equals(SUCCESS)) {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETUSERORDERLIST_SUCCESS, result.getData()));
                            } else {
                                handler.sendMessage(createMsg(MessageCode.NETWORKCODE_GETUSERORDERLIST_FAILURE, result.getMessage()));
                            }
                        } else {
                            handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETUSERORDERLIST_FAILURE);
                        }
                    } else {
                        handler.sendEmptyMessage(MessageCode.NETWORKCODE_GETUSERORDERLIST_FAILURE);
                    }
                }
            });
        } else {
            handler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }


    /**
     * 用户提问 UpUserAndDoctor(String userId,String content,List<String> image, String dir, final Handler mHandler)
     */
    public static void EditUpUserAndDoctor(String userId, String content,  List<String> images, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("userId", userId);
            postParameter.put("content", content);
            postParameter.put("images", images);
            OkHttpUtils.post().url(UrlAddress.GET_USERANDDOCTOR_URL).addParams("Data", new Gson().toJson(postParameter)).build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_EDITUPUSERSANDDOCTOR_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            if (!TextUtils.isEmpty(response)) {
                                BaseResultBean result = GsonUtils.json2BaseBean(response);
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_EDITUPUSERSANDDOCTOR_SUCCESS, result.getMessage()));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_EDITUPUSERSANDDOCTOR_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_EDITUPUSERSANDDOCTOR_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_EDITUPUSERSANDDOCTOR_FAILURE);
                            }
                        }
                    });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 咨询页面
     */
    public static void UserCount(String userId, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("userId", userId);
            OkHttpUtils.post().url(UrlAddress.GET_USERCOUNT_URL).addParams("Data", new Gson().toJson(postParameter)).build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_USERCOUNT_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            if (!TextUtils.isEmpty(response)) {
                                System.out.println("==consulter==" + response);
                                ObjectResultBean<ConsulteBeanList> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), ConsulteBeanList.class);
                             //   System.out.println("==consulter==" + result.toString());
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_USERCOUNT_SUCCESS, result.getData()));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_USERCOUNT_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_USERCOUNT_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_USERCOUNT_FAILURE);
                            }
                        }
                    });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 咨询页面
     */
    public static void UserRecord(String userId,String state,String standby,int pageIndex,int pageSize, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("userId", userId);
            postParameter.put("state", state);
            postParameter.put("standby", standby);
            postParameter.put("pageIndex", pageIndex);
            postParameter.put("pageSize", pageSize);
            OkHttpUtils.post().url(UrlAddress.GET_USERRECORD_URL).addParams("Data", new Gson().toJson(postParameter)).build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_USERRECORD_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            if (!TextUtils.isEmpty(response)) {
                                System.out.println("==userrecord==" + response);
                                ObjectResultBean<SearchRecordBeanList> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), SearchRecordBeanList.class);
                              //  System.out.println("==userrecord==" + result.toString());
                                if (result != null) {
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_USERRECORD_SUCCESS, result.getData()));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_USERRECORD_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_USERRECORD_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_USERRECORD_FAILURE);
                            }
                        }
                    });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }

    /**
     * 提问页面
     */
    public static void UserAndDoctorChat(String userId,String id,String isDoc, final Handler mHandler) {
        if (WebUtils.isConnected()) {
            instance(true);
            postParameter.put("userId", userId);
            postParameter.put("id", id);
            postParameter.put("isDoc", isDoc);
            OkHttpUtils.post().url(UrlAddress.GET_USERANDDOCTORCHAT_URL).addParams("Data", new Gson().toJson(postParameter)).build()
                    .execute(new StringCallback() {
                        @Override
                        public void onError(Call call, Exception e) {
                            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_USERANDDOCTORCHAT_FAILURE);
                        }

                        @Override
                        public void onResponse(String response) {
                            if (!TextUtils.isEmpty(response)) {
                                System.out.println("==useranddoctorchat==" + response);
                                ObjectResultBean<UchatListBean> result = GsonUtils.json2Object(response.replace("data\":\"\"", "data\":{}"), UchatListBean.class);
                                if (result != null) {
                                   // System.out.println("==useranddoctorchat==" + result.toString());
                                    if (result.getCode().equals(SUCCESS)) {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_USERANDDOCTORCHAT_SUCCESS, result.getData()));
                                    } else {
                                        mHandler.sendMessage(createMsg(MessageCode.NETWORKCODE_USERANDDOCTORCHAT_FAILURE, result.getMessage()));
                                    }
                                } else {
                                    mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_USERANDDOCTORCHAT_FAILURE);
                                }
                            } else {
                                mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_USERANDDOCTORCHAT_FAILURE);
                            }
                        }
                    });
        } else {
            mHandler.sendEmptyMessage(MessageCode.NETWORKCODE_CONNECT_ERROR);
        }
    }
}
